package com.wiscamp.ninechapters.problems.infrastructure.mappers.tasks;

import com.wiscamp.ninechapters.problems.infrastructure.po.tasks.AssignmentDetailPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;

/**
 * 习题集分发记录明细仓储对象
 *
 * @author yifeng
 */
@Repository
public interface AssignmentDetailMapper extends JpaRepository<AssignmentDetailPO, Long>, JpaSpecificationExecutor<AssignmentDetailPO> {
    @Query(value = "select e from AssignmentDetailPO e where e.assignmentId = :assignmentId")
    Collection<AssignmentDetailPO> findListByAssignment(long assignmentId);
}